package com.example.day06;

import java.util.Collection;
import java.util.Hashtable;

public class ArticleCharacters {
    public static final String ARTICLE = "阿斯蒂芬";

    public static void main(String[] args) {
        Hashtable<Character, Integer> hashtable = new Hashtable<>();

        for (int i = 0; i < ARTICLE.length(); i++){
            char c =ARTICLE.charAt(i);
            hashtable.put(c, hashtable.get(c) == null ? 1 : hashtable.get(c) + 1 );// hashtable.get(key)
        }

        for (Character character : hashtable.keySet()) {
            System.out.println(character + " -> " + hashtable.get(character));
        }
       // System.out.println(Collection.max(hashtable));
    }

}
